package de.fzi.kasma.learner.genetic;


import de.fzi.kasma.learner.path.PathGraph;
import ec.EvolutionState;
import ec.Fitness;
import ec.Individual;
import ec.Species;
import ec.simple.SimpleFitness;
import ec.util.Parameter;

public class RLSpecies  extends Species{
	 /**
	 * 
	 */
	private static final long serialVersionUID = 4858881751265815125L;
	
	
	
	public static final String P_TSPECIES = "species";

	    public Parameter defaultBase()
	        {
	        return RLDefaults.base().push(P_TSPECIES);
	        }

	    public void setup(final EvolutionState state, final Parameter base)
	        {
	        super.setup(state,base);

	        // check to make sure that our individual prototype is a RLIndividual
	        if (!(i_prototype instanceof RLIndividual))
	            state.output.fatal("The Individual class for the Species " + getClass().getName() + " is must be a subclass of RLIndividual.", base );
	        }    

	    public Individual newIndividual(EvolutionState state, int thread) 
	        {
//	        RLIndividual newind = (RLIndividual)(super.newIndividual(state, thread));
	        
	    	RLIndividual newind = new RLIndividual();
	    	newind.clauses = new PathGraph[1];
	    	newind.clauses[0] = new PathGraph();
	    	newind.clauses[0].addEdge("?user", "http://www.movie.org/ontology.owl#like", "?movie");
	    	SimpleFitness fit = new SimpleFitness();
	    	fit.setFitness(state, 0, false);
	    	newind.fitness = fit;
	        newind.reset( state, thread);

	        return newind;
	        }
}

